package com.javaweb.blogcite.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.javaweb.blogcite.mapper.AboutMapper;
import com.javaweb.blogcite.pojo.About;
import com.javaweb.blogcite.service.AboutService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class AboutServiceImpl implements AboutService {
    @Resource
    private AboutMapper aboutMapper;

    @Override
    public About listAllAbout() {

        return aboutMapper.selectList(new QueryWrapper<>()).get(0);
    }

    @Override
    public boolean updateAbout(String url) {
        About about = new About();
        about.setId(1);
        about.setUrl(url);
        int rows = aboutMapper.updateById(about);
        return rows > 0;
    }
}
/**
 * @author cbhenbo
 * @date 2020/11/23-10:36
 */